#对文件进行操作
import yaml
from autoTest_ecshop.utils.get_path import  get_yaml_path

class FileUitil():                                   #打开文件   with open(文件地址，打开方式，编码格式) as f：
    def get_yaml(self,filename):
        with open(get_yaml_path(filename),'r',encoding='utf-8') as f:
           return yaml.safe_load(f)
    def write_yaml(self,filename):
        token={"token":"内容"}
        with open(get_yaml_path(filename),'w',encoding='utf-8') as f:
           yaml.dump(token,f)
read=FileUitil()







if __name__ == '__main__':
    rs=read.get_yaml("test_data.yaml")
    print(rs['url'])
    print(rs["student"]['user'])
